<?php


namespace app\admin\validate;



use think\Validate;

class Salesman extends Validate
{
    protected $rule = [
        'username' => 'require|unique:app\admin\model\Salesman',
        'true_name' => 'require|unique:app\admin\model\Salesman',
        'mobile' => 'require|mobile',
        'password' => 'require|length:6,18',
    ];

    protected $message = [
        'username.require' => '请输入账号',
        'username.unique' => '登录账号已存在',
        'true_name.require' => '请输入姓名',
        'true_name.unique' => '姓名已存在',
        'mobile.require' => '请输入手机号',
        'mobile.mobile' => '手机号格式有误',
        'password.require' => '请输入密码',
        'password.length'  => '6-18位的登录密码',
    ];

    protected $scene = [
        'create' => [
            'username',
            'mobile',
            'true_name',
            'password',
        ],
        'edit' => [
            'id',
            'username',
            'mobile',
            'true_name',
        ],
    ];
}